<!doctype html>
<html>

<head>
  <meta charset="utf-8">
  <title>Wallpaper Engine - Matrix</title>
    <meta name="author" content="cybeerboy">
	<style type="text/css"> 
		html,
		body {
		  margin: 0;
		  padding: 0;
		  height: 100%;
		  background-color: #000000;
		}

		body {
		  overflow: hidden;
		}

		#wallpapermatrix {
		  -webkit-transform: rotateY(180deg);
		  transform: rotateY(180deg);
		  max-width: 100%;
		}
	</style> 

  <!--[if lt IE 9]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  <![endif]-->
  
</head>

<body>



<canvas id="wallpapermatrix"></canvas>
  
	<script type="text/javascript">	
	var canvas = document.getElementById('wallpapermatrix');
	var ctx = canvas.getContext('2d');
	var fontSize = 18;
	var chars = generateChars();
	var columns;
	var drops;
	var drawnToBottom;

	function generateChars() 
	{
	  var chars = '0123456789';
	  for (var i = 0; i <= 55; i++) 
	  {
	    chars += String.fromCharCode(i + 65382);
	  }
	  
	  return chars.split('');
	}

	function initCanvas() 
	{
	  canvas.width = window.innerWidth;
	  canvas.height = window.innerHeight;
	  columns = Math.round(canvas.width / fontSize);
	  drops = [];

	  for (var i = 0; i < columns; i++) 
	  {
	    drops[i] = 1;
	  }

	  drawnToBottom = false;
	}

	window.onresize = function() 
	{
	  initCanvas();
	};

	function draw() 
	{
	  ctx.fillStyle = 'rgba(0, 0, 0, 0.05)';
	  ctx.fillRect(0, 0, canvas.width, canvas.height);
	  ctx.fillStyle = '#19FF19';
	  ctx.font = 'bold ' + fontSize + 'px monospace';

	  var dropCount = drops.length;
	  var charCount = chars.length;

	  for (var i = 0; i < dropCount; i++) 
	  {
	    var text = chars[Math.floor(Math.random() * charCount)];
	    var rowNum = drops[i] * fontSize;
	    ctx.fillText(text, i * fontSize, rowNum);

	    if (rowNum > canvas.height) drawnToBottom = true;

	    if ((!drawnToBottom && Math.random() > 0.925) || (drawnToBottom && Math.random() > 0.95)) drops[i] = 0;

	    drops[i]++;
	  }
	}

	initCanvas();
	setInterval(draw, 45);
	</script>

</body>
</html>